﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemoEmployees
{
    class Program
    {
        static void Main(string[] args)
        {
            //Employee[] employees = new Employee[5];

            List<Employee> employees = new List<Employee>()
            {
                new Employee()
                {
                    firstName = "Вася",
                    lastName = "Первый",
                    salary = 100
                },
                new Employee()
                {
                    firstName = "Вася",
                    lastName = "Второй",
                    salary = 200
                }
            };

            //Employee first = new Employee()
            //{
            //    firstName = "Вася",
            //    lastName = "Первый"
            //};
            
            //Employee second = new Employee();
            //second.firstName = "Вася";
            //second.lastName = "2";
            //second.salary = 200;
            //Employee third = new Employee();
            //third.firstName = "Вася";
            //third.lastName = "3";
            //third.salary = 300;
            //Employee fourth = new Employee();
            //fourth.firstName = "Вася";
            //fourth.lastName = "4";
            //fourth.salary = 400;
            //Employee fifth = new Employee();
            //fifth.firstName = "Вася";
            //fifth.lastName = "5";
            //fifth.salary = 500;

            //employees.Add(first);
            //employees.Add(second);
            //employees.Add(third);
            //employees.Add(fourth);
            //employees.Add(fifth);


            int sumOfSellary = 0;
            foreach (var employee in employees)
            {
                employee.PrintInfo();
                sumOfSellary += employee.salary;
            }

            Console.WriteLine("Всего необходимо выплатить {0} в месяц", sumOfSellary);

        }
    }
}
